Skip to content

Bump microVersionId and add isReplica handling#6178

Open
maeldonn wants to merge 5 commits into
development/9.4from
improvement/CLDSRV-906/micro-version-id
Open

Bump microVersionId and add isReplica handling#6178
maeldonn wants to merge 5 commits into
development/9.4from
improvement/CLDSRV-906/micro-version-id

Conversation

@maeldonn
Copy link
Copy Markdown
Contributor

Cloudserver-side prep for cascaded CRR (design): bumps arsenal to the improvement/ARSN-578/micro-version-id branch, bumps microVersionId on every user-facing object metadata write through a single bumpMicroVersionId helper (gated on replicationInfo presence to keep storage tight, with a force flag preserving the existing overwriting-version path), sources x-amz-replication-status from the new ReplicationInfo.isReplica field with a legacy status === 'REPLICA' fallback, and clears isReplica on direct user writes (tagging / ACL / retention / legal hold) so a modified replica stops looking like one. The backbeat-route side of the design (setting isReplica = true on incoming replicas, cascade comparison, MultiBackend guard) lands in a follow-up ticket — until then the new fields are read but never set, so observable behavior is unchanged.

Issue: CLDSRV-906

@maeldonn maeldonn requested review from a team, benzekrimaha and delthas May 29, 2026 08:13
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 29, 2026

Hello maeldonn,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 29, 2026

Incorrect fix version

The Fix Version/s in issue CLDSRV-906 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.4.0

Please check the Fix Version/s of CLDSRV-906, or the target
branch of this pull request.

Comment thread package.json Outdated
Comment thread tests/unit/api/apiUtils/object/bumpMicroVersionId.js Outdated
Comment thread tests/unit/api/objectReplicationMD.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented May 29, 2026

  • arsenal is pinned to a branch instead of a tag in package.json — git-based deps must pin to a tag for reproducible builds.
    - Test names in tests/unit/api/apiUtils/object/bumpMicroVersionId.js and tests/unit/api/objectReplicationMD.js should start with "should".

    Review by Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 86.64688% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.24%. Comparing base (9fc5974) to head (28a3bfb).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/services.js 74.59% 31 Missing ⚠️
lib/api/objectPutRetention.js 93.47% 3 Missing ⚠️
lib/metadata/acl.js 88.00% 3 Missing ⚠️
lib/api/objectDeleteTagging.js 94.59% 2 Missing ⚠️
lib/api/objectPutLegalHold.js 94.59% 2 Missing ⚠️
lib/api/objectPutTagging.js 94.87% 2 Missing ⚠️
lib/api/apiUtils/object/bumpMicroVersionId.js 85.71% 1 Missing ⚠️
lib/utilities/collectResponseHeaders.js 95.83% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/object/bumpMicroVersionId.js 85.71% <85.71%> (ø)
lib/utilities/collectResponseHeaders.js 98.30% <95.83%> (-1.70%) ⬇️
lib/api/objectDeleteTagging.js 96.55% <94.59%> (-3.45%) ⬇️
lib/api/objectPutLegalHold.js 92.98% <94.59%> (-1.47%) ⬇️
lib/api/objectPutTagging.js 96.66% <94.87%> (-3.34%) ⬇️
lib/api/objectPutRetention.js 92.85% <93.47%> (-2.60%) ⬇️
lib/metadata/acl.js 94.87% <88.00%> (-3.82%) ⬇️
lib/services.js 86.38% <74.59%> (-1.05%) ⬇️

... and 3 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.4    #6178      +/-   ##
===================================================
- Coverage            85.25%   85.24%   -0.02%     
===================================================
  Files                  208      209       +1     
  Lines                13919    13945      +26     
===================================================
+ Hits                 11867    11887      +20     
- Misses                2052     2058       +6     
Flag Coverage Δ
file-ft-tests 68.89% <85.75%> (+0.07%) ⬆️
kmip-ft-tests 28.16% <18.10%> (+0.03%) ⬆️
mongo-v0-ft-tests 69.99% <86.64%> (-0.10%) ⬇️
mongo-v1-ft-tests 69.98% <86.64%> (+0.01%) ⬆️
multiple-backend 36.65% <28.48%> (+0.04%) ⬆️
sur-tests 35.47% <28.78%> (+0.01%) ⬆️
sur-tests-inflights 37.38% <29.67%> (+0.04%) ⬆️
utapi-v2-tests 34.82% <29.37%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread lib/api/objectDeleteTagging.js Outdated
Comment thread lib/api/objectPutLegalHold.js Outdated
const { instanceId, replicationGroupId } = config;

// eslint-disable-next-line no-param-reassign
objectMD.microVersionId = versioning.VersionID.generateVersionId(instanceId, replicationGroupId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a method ObjectMD.updateMicroVersionId() in arsenal ? should it not be used instead?

(if we can't because of POJO, then I wonder if that function was really useful....)

Comment thread lib/services.js
if (updateMicroVersionId) {
md.updateMicroVersionId();
}
bumpMicroVersionId(md.getValue(), updateMicroVersionId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • is this not redundant with the other calls in APIs ?
  • calling it here we ALWAYS generate a new microVersionId when creating a new object: which is not needed since it comes with a new versionId... (except for non-versioned case, but no replication there: so the function does nothing)

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 3b4110b to 6ba0ebe Compare June 3, 2026 14:09
Comment thread package.json Outdated
Comment thread tests/unit/api/apiUtils/object/bumpMicroVersionId.js Outdated
Comment thread tests/unit/api/objectReplicationMD.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Jun 3, 2026

  • Arsenal dependency is pinned to a branch, not a tag — pin to a tagged release before merging to production
    - Test names in bumpMicroVersionId.js and objectReplicationMD.js should start with should per project convention

    Review by Claude Code

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 6ba0ebe to ce0ff8e Compare June 3, 2026 14:14
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jun 3, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Comment thread package.json
Comment thread tests/unit/api/apiUtils/object/bumpMicroVersionId.js Outdated
Comment thread tests/unit/api/objectReplicationMD.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Jun 3, 2026

  • Arsenal dependency pinned to a commit SHA instead of a release tag (package.json)
    - Pin to a tagged release before merging; the previous value was 8.4.4
    - Test names in it() blocks don't start with "should" (bumpMicroVersionId.js, objectReplicationMD.js)
    - Prefix test descriptions with "should" per project conventions

    Review by Claude Code

maeldonn added 5 commits June 3, 2026 17:08
Prefer ReplicationInfo.isReplica over replicationInfo.status when
producing x-amz-replication-status. The legacy status === 'REPLICA'
branch is kept as a fallback so objects written before the feature
still surface the correct value.

Issue: CLDSRV-906
Bump microVersionId on every user write that changes object metadata
other than replicationInfo, providing a unique revision identifier
needed by upcoming cascaded CRR loop detection.

Issue: CLDSRV-906
When a user updates tags, ACL, retention, or legal-hold on an object
that arrived via replication (isReplica=true), the resulting object is
no longer a replica - clear the flag so the x-amz-replication-status
response header reflects the new state.

Issue: CLDSRV-906
@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from ce0ff8e to 28a3bfb Compare June 3, 2026 15:12
Comment thread lib/api/objectDeleteTagging.js Dismissed
Comment thread lib/api/objectDeleteTagging.js Dismissed
Comment thread lib/api/objectDeleteTagging.js Dismissed
Comment thread lib/api/objectPutLegalHold.js Dismissed
Comment thread lib/api/objectPutLegalHold.js Dismissed
Comment thread lib/api/objectPutTagging.js Dismissed
Comment thread lib/api/objectPutTagging.js Dismissed
Comment thread lib/services.js Dismissed
Comment thread lib/services.js Dismissed
Comment thread lib/services.js Dismissed
Comment thread package.json
@claude
Copy link
Copy Markdown

claude Bot commented Jun 3, 2026

  • Arsenal dependency pinned to a commit hash instead of a release tag (package.json:36). Update to a tag once the arsenal improvement/ARSN-578/micro-version-id branch changes are released.

    The logic changes (bumpMicroVersionId helper, isReplica clearing on user writes, isReplica-aware replication-status header) are correct and well-tested.

    Review by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants